package JavaSE;

import java.util.*;

public class thief {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        String right = "芝麻开门";
        int chance = 5;
        String input;
        while (chance > 0) {
            input = cin.nextLine();
            if (input.equals(right)) {
                System.out.println("咒语正确，请进入山洞");
                break;
            } else {

                System.out.println("咒语错误，请重新尝试");

                chance--;
            }
        }
        if (chance == 0) System.out.println("咒语错误超过5次，你永久失去进入山洞资格");


    }

}